package com.gbei.center.oauth.req;

import com.gbei.center.enums.MerchantTypeEnum;
import com.gbei.center.req.open.ReqCommon;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 添加商户请求参数
 *
 * @author lixuzhou@foxmail.com
 * @version 0.1 2018/11/5
 */
@Data
@ApiModel(value = "添加商户请求参数")
public class ReqAddMerchant extends ReqCommon implements Serializable {

  private static final long serialVersionUID = 9002352877409726399L;

  @ApiModelProperty(value = "调用端业务主键", required = true, example = "ID_MCH_0001")
  @NotBlank(message = "bizId 不能为空")
  private String bizId;

  @ApiModelProperty(value = "商户区域ID", required = true, example = "440305")
  @NotNull(message = "areaId 不能为空")
  @Pattern(regexp = "^\\d{5}[1-9]$")
  private String areaId;

  @ApiModelProperty(value = "运营区域下主经营主体类型", required = true, example = "MERCHANT")
  @NotNull(message = "type 不能为空")
  private MerchantTypeEnum type;

  /**
   * 水机系统通过获取openId接口获取机主结算是在水机系统结算现金还是京贝尔系统结算GB
   */
  @ApiModelProperty(value = "机主GB奖励是否由京贝尔独立结算 type为OWNER时必传", required = true, example = "MERCHANT")
  private Boolean isOwnerGbRewardByGbei;

  @ApiModelProperty(value = "商户手机号", required = true, example = "15507552820")
  @NotBlank(message = "mobile 不能为空")
  private String mobile;

  @ApiModelProperty(value = "邀请人openId（仅当商户为新用户时生效）", example = "1a209e0b341fd79a25481dc9f19cf8bf")
  private String inviteOpenId;
  
  @ApiModelProperty(value = "用户姓名", example = "李旭洲")
  private String userName;
  
  @ApiModelProperty(value = "用户身份证号", example = "440305199009091234")
  private String idcard;

  public String getAreaId12() {
    return areaId + "000000";
  }
}
